#! /bin/sh

#---------------------------------------------------------------------
#                           chicken and egg                           
#---------------------------------------------------------------------

test -f "${FW_ROOT}/share/fw/sh/fw-find.sh" && fws="${FW_ROOT}/share/fw/sh/fw-find.sh"
test -f "fw/sh/fw-find.sh" && fws="fw/sh/fw-find.sh"
test -f "fw.local/sh/fw-find.sh" && fws="fw.local/sh/fw-find.sh"
test ! -z "$fws" || {
  echo "revision/svn/init-fw-pkgin-config: fatal: can't locate fw-find.sh" 1>&2
  exit 1
}

. "$fws"

#---------------------------------------------------------------------
#                              routines                               
#---------------------------------------------------------------------

fw_source "revision/svn/init-fw-pkgin-config" "sh/fatal.sh"
fw_source "revision/svn/init-fw-pkgin-config" "sh/parse-args.sh"
fw_source "revision/svn/init-fw-pkgin-config" "sh/validate-args.sh"

#---------------------------------------------------------------------
#                                main                                 
#---------------------------------------------------------------------

parse_args "revision/svn/init-fw-pkgin-config" "$@"

validate_args "revision/svn/init-fw-pkgin-config" "name svn_tag_root" ""

(
  cd fw-pkgin &&
  cat <<EOD >> config

# set to the directory in which version-named tags will be created
FW_SUBVERSION_TAG_ROOT="$svn_tag_root"
EOD
) || fatal "revision/svn/init-fw-pkgin-config"
